#ifndef __TASK_BUFF_H
#define __TASK_BUFF_H

#define TASK_BUFF_SIZE 1024
#define STAT_SYS_BUSY 0x1
#define STAT_SYS_FREE 0x0
#define STAT_SYS_MIDDLE 0x2


typedef struct
{
	pthread_cond_t cond;
	pthread_mutex_t mutex;
	int buff_len;
	char buff[TASK_BUFF_SIZE];
}S_TASK_BUFF, *PS_TASK_BUFF;


int updata_sys_stat(PS_PACKET_DATA pst, struct sockaddr *pstAddr);
int task_buff_init();
int task_buff_write(char *data, int data_len);
int task_buff_read(char *buff, int buff_len);
int task_buff_read_timeout(char *buff, int buff_len, int time_out);
unsigned char get_sys_stat();
void set_sys_stat(unsigned char stat);
unsigned char get_cur_sn();
unsigned char get_cur_task();
struct sockaddr *get_cur_addr();





#endif
